<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript">
        ((w, d) => {
            function setSize() {
                var screenWidth = d.documentElement.clientWidth;
                var currentFontSize = screenWidth * 100 / 750;
                d.documentElement.style.fontSize = currentFontSize + 'px';
            }
            w.addEventListener('resize', setSize);
            w.addEventListener('pageShow', setSize)
            w.addEventListener('DOMContentLoaded', setSize)
        })(window, document)
    </script>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .box {
            width: 3.75rem;
            height: 3.75rem;
            float: left;
        }

        .box1 {
            background: red;
        }

        .box2 {
            background: yellow;
        }
    </style>
</head>

<body>
    <div class="box box1"></div>
    <div class="box box2"></div>
</body>

</html>